package test2;


 abstract class Shape {
    public final double PI = 3.14;
    public abstract double getPerimeter();
    public abstract double getArea();


}

class Rectangle extends  Shape{
    int width;
    int length;
    public Rectangle(int width,int length){
        this.width =width;
        this.length = length;
    }

    @Override
    public double getPerimeter() {
        return 2*(width+length);
    }

    @Override
    public double getArea() {
        return width*length;
    }

    @Override
    public String toString() {
        return "Rectangle [" +
                "width=" + width +
                ", length=" + length +
                '}';
    }

}

class Circle extends Shape {
    int r;
    public Circle(int radius) {
        this.r = radius;
    }

    @Override
    public double getPerimeter() {
        return 2*PI*r;
    }

    @Override
    public double getArea() {
        return PI*r*r;
    }

    @Override
    public String toString() {
        return "Circle[" +
                "r=" + r +
                ']';
    }
}